package mdb.com.vn.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * @author tu.dod
 * 
 */
@Entity
@Table(name = "IFTB_FD_CASA")
@NamedQueries({
		@NamedQuery(name = "FixedDepositCasa.findByPersionalType", query = "SELECT c FROM FixedDepositCasa c WHERE c.customerType = :customerType"),
		@NamedQuery(name = "FixedDepositCasa.getAllFixedDepositCasa", query = "SELECT c FROM FixedDepositCasa c"),
		@NamedQuery(name = "FixedDepositCasa.findByCode", query = "SELECT c FROM FixedDepositCasa c WHERE c.savingbookNo = :savingbookNo OR c.accountLocked = :accountLocked"),
		@NamedQuery(name = "FixedDepositCasa.findByCodeSaving", query = "SELECT c FROM FixedDepositCasa c WHERE c.savingbookNo = :savingbookNo"),
		@NamedQuery(name = "FixedDepositCasa.findByCodeSavingAcc", query = "SELECT c FROM FixedDepositCasa c WHERE c.accountLocked = :accountLocked"),
		@NamedQuery(name = "FixedDepositCasa.findByCorporateType", query = "SELECT c FROM FixedDepositCasa c WHERE c.customerType = :customerType"),
		@NamedQuery(name = "FixedDepositCasa.countThanksCard", query = "SELECT sum(c.checkGetThankSC) FROM FixedDepositCasa c"),
		@NamedQuery(name = "FixedDepositCasa.sumAmount", query = "SELECT sum(c.fdAmount + c.amountLocked) FROM FixedDepositCasa c"),
		@NamedQuery(name = "FixedDepositCasa.findByCustomerRef", query = "SELECT c FROM FixedDepositCasa c WHERE c.customerId = :customerId")})
public class FixedDepositCasa extends BasePojo implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "GSEQ_FD_CASA")
	@SequenceGenerator(name = "GSEQ_FD_CASA", sequenceName = "SEQ_FD_CASA")
	private long id;

	@Column(name = "ACCOUNT_LOCKED")
	private String accountLocked;

	@Column(name = "ADDRESS")
	private String address;

	@Column(name = "AMOUNT_LOCKED")
	private BigDecimal amountLocked;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "START_DATE_LOCKED")
	private Date startDateLocked;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "END_DATE_LOCKED")
	private Date endDateLocked;
	

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "END_DATE")
	private Date endDate;

	@Column(name = "FD_AMOUNT")
	private BigDecimal fdAmount;

	@Column(name = "FD_TERM")
	private String fdTerm;

	@Column(name = "INTEREST_RATE")
	private double interestRate;

	@Column(name = "SAVINGBOOK_NO")
	private String savingbookNo;
	
	@Column(name = "CATEGORY")
	private String category;
	
	@Column(name="PRODUCT_CODE")
	private String productCode;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "START_DATE")
	private Date startDate;

	@Column(name = "TERM_LOCKED")
	private int termLocked;

	@Column(name = "WB_BALANCES")
	private BigDecimal wbBalances;
	
	@Column(name = "ACC_INTEREST_RATE")
	private double accInterestRate;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "OPENING_DATE")
	private Date openingDate;
	

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getAccountLocked() {
		return accountLocked;
	}

	public void setAccountLocked(String accountLocked) {
		this.accountLocked = accountLocked;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}


	
	public Date getStartDateLocked() {
		return startDateLocked;
	}

	public void setStartDateLocked(Date startDateLocked) {
		this.startDateLocked = startDateLocked;
	}

	public Date getEndDateLocked() {
		return endDateLocked;
	}

	public void setEndDateLocked(Date endDateLocked) {
		this.endDateLocked = endDateLocked;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public BigDecimal getFdAmount() {
		return fdAmount;
	}

	public void setFdAmount(BigDecimal fdAmount) {
		this.fdAmount = fdAmount;
	}

	public String getFdTerm() {
		return fdTerm;
	}

	public void setFdTerm(String fdTerm) {
		this.fdTerm = fdTerm;
	}

	public double getInterestRate() {
		return interestRate;
	}

	public void setInterestRate(double interestRate) {
		this.interestRate = interestRate;
	}

	public String getSavingbookNo() {
		return savingbookNo;
	}

	public void setSavingbookNo(String savingbookNo) {
		this.savingbookNo = savingbookNo;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public int getTermLocked() {
		return termLocked;
	}

	public void setTermLocked(int termLocked) {
		this.termLocked = termLocked;
	}

	public BigDecimal getAmountLocked() {
		return amountLocked;
	}

	public void setAmountLocked(BigDecimal amountLocked) {
		this.amountLocked = amountLocked;
	}

	public BigDecimal getWbBalances() {
		return wbBalances;
	}

	public void setWbBalances(BigDecimal wbBalances) {
		this.wbBalances = wbBalances;
	}

	public double getAccInterestRate() {
		return accInterestRate;
	}

	public void setAccInterestRate(double accInterestRate) {
		this.accInterestRate = accInterestRate;
	}

	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public String getProductCode() {
		return productCode;
	}

	public void setProductCode(String productCode) {
		this.productCode = productCode;
	}

	public Date getOpeningDate() {
		return openingDate;
	}

	public void setOpeningDate(Date openingDate) {
		this.openingDate = openingDate;
	}


}
